# @Version:1.0
# @Author：green-citrus

# 对 str 进行切片
# str = "hello world"
# str_slice = str[0:5]
# print("str_slice:", str_slice) # hello
#
# # 对列表进行切片
# list_a = ["jack", "tom", "nono", "mary"]
# list_a_slice = list_a[1:3]
# print("list_a_slice:", list_a_slice) # ['tom', 'nono']
#
# # 对元组进行切片
# tuple_a = (100, 200, 300, 400, 500, 600)
# tuple_a_slice = tuple_a[1:5]
# print("tuple_a_slice:", tuple_a_slice) # (200, 300, 400, 500)

# str = "hello world"
# print(str[:6:1]) # 从下标6开始截取到末尾，hello
# print(str[1::1]) # 从下标1开始一直截取到末尾，ello world
# print(str[::1]) # 截取整个字符串，hello world
# print(str[2:5:]) # 从下标2开始一直截取到下标5处，llo

# str = "123456"
# print(str[-1::-1]) # 从倒数第一个开始从右向左一个一个截取，654321
# print(str[-1:-6:-2]) # 从倒数第一个开始，截取到倒数第5个，从右向左每隔一个截取，642

# list_name = ["yack", "Lisa", "Hsp", "Paul", "Smith", "Kobe"]
# print(list_name[-3::1]) # 取出后三个并保持顺序

